import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';
import 'package:cached_network_image/cached_network_image.dart';

class ResPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('静态资源导入'),
      ),
      body:SingleChildScrollView(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Image(
                image: AssetImage('images/15.jpg'),
                width: 300.0,
                height: 300.0,
              ),
              Image.network(
                "http://www.devio.org/img/avatar.png",
              ),
              Stack(
                children: <Widget>[
                  Center(
                    child: CircularProgressIndicator(),
                  ),
                  Center(
                    child: FadeInImage.memoryNetwork(
                        placeholder: kTransparentImage,
                        image: "http://www.devio.org/img/avatar.png"
                    ),
                  )
                ],
              ),
              Center(
                child: CachedNetworkImage(
                  placeholder: (context,url)=>CircularProgressIndicator(),
                  imageUrl: 'https://picsum.photos/250?image=9',
                ),
              ),
              Icon(
                Icons.android,
                size: 100,
              )
            ],
          ),
        ),
      )
    );
  }
}
